package com.soecode.wxtools.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
public class SenderContent {
    private Media mpnews;
    private NewsList news;
    private Text text;
    private Media voice;
    private Media image;
    private Media mpvideo;
    private Media video;
    private Media music;

    /**
     * 媒体包括图文语音视频图片
     *
     * @author antgan
     */
    @Data
    @NoArgsConstructor
    public static class Media {
        private String media_id;
        private String thumb_media_id;
        private String title;
        private String description;
        private String musicurl;
        private String hqmusicurl;

        public Media(String media_id) {
            this.media_id = media_id;
        }

        public Media(String media_id, String thumb_media_id, String title, String description) {
            this.media_id = media_id;
            this.thumb_media_id = thumb_media_id;
            this.title = title;
            this.description = description;
        }

        public Media(String thumb_media_id, String title, String description, String musicurl,
                     String hqmusicurl) {
            this.thumb_media_id = thumb_media_id;
            this.title = title;
            this.description = description;
            this.musicurl = musicurl;
            this.hqmusicurl = hqmusicurl;
        }
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Text {
        private String content;
    }

    @Data
    @AllArgsConstructor
    public static class NewsList {
        private List<News> articles;

        @Data
        public static class News {
            private String title;
            private String description;
            private String url;
            private String picurl;

            public News(String title, String description, String url, String picurl) {
                this.title = title;
                this.description = description;
                this.url = url;
                this.picurl = picurl;
            }
        }
    }
}

